#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int findGCD(int* nums, int numsSize) {
    int max = 0;
    int min = nums[0];
    for (int i = 0; i < numsSize; i++)
    {
        if (max < nums[i])
            max = nums[i];
        else if (min > nums[i])
            min = nums[i];
    }
    int mid = 0;
    while (min)
    {
        mid = max % min;
        max = min;
        min = mid;
    }
    return max;
}